//
//  MapDesCollectionViewCell.m
//  LZMPro
//
//  Created by dllo on 15/11/7.
//  Copyright © 2015年 LZS. All rights reserved.
//

#import "MapDesCollectionViewCell.h"
#import "MapDesCItyModel.h"
@interface MapDesCollectionViewCell ()

@property (nonatomic, retain)UIImageView *imageView;
@property (nonatomic, retain)UILabel *name;

@end

@implementation MapDesCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubViews];
    }
    return self;
}

-(void)setModel:(BaseModel *)model
{
    _model = model;
    MapDesCItyModel *m = (MapDesCItyModel *)_model;
    
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:m.cover] placeholderImage:[UIImage imageNamed:@"bundle_spot_edit_default_cover"]];
    self.name.text = m.name;

}

- (void)createSubViews{
    
    self.layer.masksToBounds = YES;
    self.layer.cornerRadius = 10;
    
    self.imageView = [[UIImageView alloc]initWithFrame:self.bounds];
    self.imageView.contentMode = UIViewContentModeScaleAspectFill;
    self.imageView.layer.masksToBounds = YES;
    [self addSubview:self.imageView];
    
    
    self.name = [[UILabel alloc]initWithFrame:CGRectMake(self.contentView.width * 0.1, self.contentView.height * 0.8, self.contentView.width * 0.8, self.contentView.height * 0.2)];
    self.name.textColor = [UIColor whiteColor];
    self.name.font = [UIFont boldSystemFontOfSize:16];
    
    [self addSubview:self.name];

}




@end
